package com.tsunami.authority.provider;

import com.tsunami.authority.provider.impl.AdminProviderFallback;
import com.tsunami.base.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Classname UserProvider
 * @Description TODO
 * @date 2021-11-18 9:49
 * @author lx
 */
@FeignClient(value = "tsunami-auth-admin",fallback = AdminProviderFallback.class)
public interface AdminProvider {

    @RequestMapping(value="/user/selectByAccount", method= RequestMethod.GET)
    R selectByAccount(@RequestParam(value = "username") String username);

    @RequestMapping(value="/resource/findVisibleResource", method= RequestMethod.GET)
    R findVisibleResource(@RequestParam(value = "userId") Long userId);

    @RequestMapping(value="/role/findRolesByUser", method= RequestMethod.GET)
    R findRolesByUser(@RequestParam(value = "userId") Long userId);
}
